package com.corticon.dialogs.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * Score entity.
 * 
 * @author Yanglifan
 */
@Entity
@Table(name = "score")
public class Score extends AuditableEntity implements Serializable {

    private Long scoreId;
    private String id;
    private RiskRating riskRating;
    private long max;
    private long min;

    public Score() {
    }

    @Id
    @SequenceGenerator(name = "score_id_seq",
            sequenceName = "score_id_seq",
            allocationSize = 1, initialValue = 1) // Set allocationSize and initialValue
                                                  // to let sequence increment following DB.
@GeneratedValue(strategy = GenerationType.AUTO, generator = "score_id_seq")
    @Column(name = "score_id", columnDefinition = "integer")
    public Long getScoreId() {
        return this.scoreId;
    }

    public void setScoreId(Long scoreId) {
        this.scoreId = scoreId;
    }

    @Column(name = "id")
    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "rrassoc_rr_id_oid")
    public RiskRating getRiskRating() {
        return this.riskRating;
    }

    public void setRiskRating(RiskRating riskRating) {
        this.riskRating = riskRating;
    }

    @Column(name = "max")
    public Long getMax() {
        return this.max;
    }

    public void setMax(Long max) {
        this.max = max;
    }

    @Column(name = "min")
    public Long getMin() {
        return this.min;
    }

    public void setMin(Long min) {
        this.min = min;
    }
}